var addDigit; 
var total = ""; 
var total2 = ""; 
window.addEventListener("load",myOnLoadFunction);
 	var strChar; 
	var strValidChars = "*+-/"; 
function myOnLoadFunction()
{
	total = ""; 
	total2 = ""; 
	calc.display.value = ""; 
}

function addtoDisplay(integer) 
{
	addDigit = integer; 
	total += integer; 
	calc.display.value += addDigit;
	
}
function clearDisplay()
{
	calc.display.value = "";
	total = ""; 
	total2 = ""; 
}
/*
function equalDisplay()
{
	total2 = total.split("*"); 
	totalplus = total.split("+");
	totaldivide = total.split("/");
	totalsub = total.split("-"); 
	var n = "";
	for (var i = 0; i < total.length; i++)
	{
		console.log(i); 
		if (total.charAt(i) == "*")
		{
		calc.display.value = parseFloat(total2[0]) * parseFloat(total2[1]);
		console.log(i);
		}
		else if (total.charAt(i) == "-")
		{
			console.log(i); 
			calc.display.value = parseFloat(totalsub[0]) - parseFloat(totalsub[1]);
		}
		else if (total.charAt(i) == "+")
		{
			calc.display.value = parseFloat(totalplus[0]) + parseFloat(totalplus[1]);
		}
		else if (total.charAt(i) == "/")
		{
			calc.display.value = parseFloat(totaldivide[0]) / parseFloat(totaldivide[1]);
		}
	
	}

}
*/
